package dominio;
// Generated 11-01-2014 10:14:49 AM by Hibernate Tools 3.6.0


import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Clientetarjeta generated by hbm2java
 */
@Entity
@Table(name="clientetarjeta"
    ,catalog="g1"
)
public class Clientetarjeta  implements java.io.Serializable {


     private ClientetarjetaId id;
     private Tarjetacredito tarjetacredito;
     private Cliente cliente;
     private Date fechaEmision;
     private BigDecimal limiteCredito;
     private int puntosTarjeta;
     private Set clientetarjetaestados = new HashSet(0);

    public Clientetarjeta() {
    }

	
    public Clientetarjeta(ClientetarjetaId id, Tarjetacredito tarjetacredito, Cliente cliente, Date fechaEmision, BigDecimal limiteCredito, int puntosTarjeta) {
        this.id = id;
        this.tarjetacredito = tarjetacredito;
        this.cliente = cliente;
        this.fechaEmision = fechaEmision;
        this.limiteCredito = limiteCredito;
        this.puntosTarjeta = puntosTarjeta;
    }
    public Clientetarjeta(ClientetarjetaId id, Tarjetacredito tarjetacredito, Cliente cliente, Date fechaEmision, BigDecimal limiteCredito, int puntosTarjeta, Set clientetarjetaestados) {
       this.id = id;
       this.tarjetacredito = tarjetacredito;
       this.cliente = cliente;
       this.fechaEmision = fechaEmision;
       this.limiteCredito = limiteCredito;
       this.puntosTarjeta = puntosTarjeta;
       this.clientetarjetaestados = clientetarjetaestados;
    }
   
     @EmbeddedId

    
    @AttributeOverrides( {
        @AttributeOverride(name="idCliente", column=@Column(name="idCliente", nullable=false) ), 
        @AttributeOverride(name="idTarjetaCredito", column=@Column(name="idTarjetaCredito", nullable=false) ) } )
    public ClientetarjetaId getId() {
        return this.id;
    }
    
    public void setId(ClientetarjetaId id) {
        this.id = id;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idTarjetaCredito", nullable=false, insertable=false, updatable=false)
    public Tarjetacredito getTarjetacredito() {
        return this.tarjetacredito;
    }
    
    public void setTarjetacredito(Tarjetacredito tarjetacredito) {
        this.tarjetacredito = tarjetacredito;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idCliente", nullable=false, insertable=false, updatable=false)
    public Cliente getCliente() {
        return this.cliente;
    }
    
    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="fecha_emision", nullable=false, length=10)
    public Date getFechaEmision() {
        return this.fechaEmision;
    }
    
    public void setFechaEmision(Date fechaEmision) {
        this.fechaEmision = fechaEmision;
    }

    
    @Column(name="limite_credito", nullable=false, precision=11)
    public BigDecimal getLimiteCredito() {
        return this.limiteCredito;
    }
    
    public void setLimiteCredito(BigDecimal limiteCredito) {
        this.limiteCredito = limiteCredito;
    }

    
    @Column(name="puntos_tarjeta", nullable=false, precision=6, scale=0)
    public int getPuntosTarjeta() {
        return this.puntosTarjeta;
    }
    
    public void setPuntosTarjeta(int puntosTarjeta) {
        this.puntosTarjeta = puntosTarjeta;
    }

//@OneToMany(fetch=FetchType.LAZY, mappedBy="clientetarjeta")
  /*  public Set getClientetarjetaestados() {
        return this.clientetarjetaestados;
    }
    
    public void setClientetarjetaestados(Set clientetarjetaestados) {
        this.clientetarjetaestados = clientetarjetaestados;
    }
*/



}


